<pre><?php
//phpinfo();

require('globals.php');

$table = $_POST["table"];
$release_group = $_POST["a-b-selector"];

//$adjustment_statement = "UPDATE " . $tables_table . " SET row_a_assignment = '000',
//							row_b_assignment = '000' where row_number = \"" . $table . "\"";

$adjustment_statement = "UPDATE " . $tables_table . " SET ";

switch($release_group) {
	case ('A'):
		$adjustment_statement .= "row_a_assignment = '000' ";
		break;
	case ('B'):
		$adjustment_statement .= "row_b_assignment = '000' ";
		break;
	case ('AB'):
		$adjustment_statement .= "row_a_assignment = '000', row_b_assignment = '000' ";
		break;
	default:
		die("Impossible condition detected, exiting.");
}

$adjustment_statement .= "where row_number = \"" . $table . "\"";

//echo $adjustment_statement;

// connect to the mysql database server.
$connect = mysql_connect($host, $user, $password);
if (!$connect)
	die('Could not connect: ' . mysql_error());
mysql_select_db($database);

if (!mysql_query($adjustment_statement, $connect))
	echo mysql_error();
else
	echo "Table " . $table . " has been released.";

mysql_close($connect)

?></pre>